<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php
$data = $dataProvider->getData();
$pagination = $dataProvider->getPagination();
$currentPage = $pagination->currentPage+1;
$pageCount = $pagination->pageCount;

$topPageCss = "";$param = $_REQUEST;
$param["page"]=1;
$topPageUrl = Yii::app()->createUrl($this->getOwner()->route,$param);
if($currentPage==1){
	$topPageCss = "disabled";
	$topPageUrl = "#";
}
$beforePageCss = "";$param["page"]=$currentPage-1;
$beforePageUrl = Yii::app()->createUrl($this->getOwner()->route,$param);
if($currentPage==1){
	$beforePageCss = "disabled";
	$beforePageUrl = "#";
}
$nextPageCss = "";$param["page"]=$currentPage+1;
$nextPageUrl = Yii::app()->createUrl($this->getOwner()->route,$param);
if($currentPage==$pageCount){
	$nextPageCss = "disabled";
	$nextPageUrl = "#";
}
$lastPageCss = "";$param["page"]=$pagination->pageCount;
$lastPageUrl = Yii::app()->createUrl($this->getOwner()->route,$param);
if($currentPage==$pageCount){
	$lastPageCss = "disabled";
	$lastPageUrl = "#";
}
?>
<?php
if(count($data)==0){
	echo("<br><br><br><div id='message' class='updated'><p>没有满足条件的记录。</p></div>");
}else{
	?>
<div class='tablenav-pages'><span class="displaying-num"><?php echo($pagination->itemCount)?>
个项目</span> <span class='pagination-links'><a
	class='first-page <?php echo($topPageCss);?>' title='前往第一页'
	href='<?php echo($topPageUrl);?>'>&laquo;</a> <a
	class='prev-page <?php echo($beforePageCss);?>' title='前往上一页'
	href='<?php echo($beforePageUrl);?>'>&lsaquo;</a> <span
	class="paging-input">第 <input class='current-page' title='当前页面'
	type='text' name='page' value='<?php echo($currentPage);?>' size='1' />
页，共 <span class='total-pages'><?php echo($pagination->pageCount);?></span>
页</span> <a class='next-page <?php echo($nextPageCss);?>' title='前往下一页'
	href='<?php echo($nextPageUrl);?>'>&rsaquo;</a> <a
	class='last-page <?php echo($lastPageCss);?>' title='前往最后一页'
	href='<?php echo($lastPageUrl);?>'>&raquo;</a></span></div>
<br class="clear">

<table cellspacing="0" class="Miniyun-list-table widefat fixed users">
	<thead>
		<tr>
			<th style="" class="manage-column column-cb check-column" id="cb"
				scope="col"><input type="checkbox"></th>
				<?php foreach(array_values($model->attributeLabels()) as $index=>$columnName):?>
			<th style="" class="manage-column column-username sortable desc"
				id="username" scope="col"><a href="#"><span><?php echo($columnName);?></span><span
				class="sorting-indicator"></span></a></th>
				<?php endforeach;?>
		</tr>
	</thead>

	<tfoot>
		<tr>
			<th style="" class="manage-column column-cb check-column" scope="col"><input
				type="checkbox"></th>
				<?php foreach(array_values($model->attributeLabels()) as $index=>$columnName):?>
			<th style="" class="manage-column column-username sortable desc"
				scope="col"><a href="#"><span><?php echo($columnName);?></span><span
				class="sorting-indicator"></span></a></th>
				<?php endforeach;?>
		</tr>
	</tfoot>

	<tbody class="list:user" id="the-list">
	<?php
	foreach($data as $index=>$item){
		$id=$item["id"];
		?>
		<tr class="alternate" id="miniyun_<?php echo($id);?>">
			<th class="check-column" scope="row"><input type="checkbox"
				value="<?php echo($id);?>" class="administrator"
				id="miniyun_<?php echo($id);?>" name="selectItems[]"></th>
				<?php foreach(array_keys($model->attributeLabels()) as $index1=>$key):?>
			<td class="username column-username">
			<?php
				$item->owner = $this;
				$method = $key.'Detail';
				if(method_exists($item,$method)){
					$value = $item->{$method}();
					if(is_string($value)){
						echo($value);
					}
				}else{
					echo($item->{$key});
				}
				?><br>
				<?php
								if($index1==0):?>
			<div class="row-actions"><span class="edit"><?php echo($item->getItemOperates()); ?></span></div>
			<?php endif;?></td>
			<?php endforeach;?>
		</tr>
		<?php }?>
	</tbody>
</table>
<div class="tablenav bottom">
<div class='tablenav-pages'><span class="displaying-num"><?php echo($pagination->itemCount)?>
个项目</span> <span class='pagination-links'><a
	class='first-page <?php echo($topPageCss);?>' title='前往第一页'
	href='<?php echo($topPageUrl);?>'>&laquo;</a> <a
	class='prev-page <?php echo($beforePageCss);?>' title='前往上一页'
	href='<?php echo($beforePageUrl);?>'>&lsaquo;</a> <span
	class="paging-input">第 <?php echo($currentPage);?>
页，共 <span class='total-pages'><?php echo($pagination->pageCount);?></span>
页</span> <a class='next-page <?php echo($nextPageCss);?>' title='前往下一页'
	href='<?php echo($nextPageUrl);?>'>&rsaquo;</a> <a
	class='last-page <?php echo($lastPageCss);?>' title='前往最后一页'
	href='<?php echo($lastPageUrl);?>'>&raquo;</a></span></div>
<br class="clear">
</div>
		<?php }?>